fix: 전체 테스트 코드 통과되도록 수정 #120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
관련 이슈
작업 내용
실패하는 테스트 코드들을 수정했습니다.
문제 해결 과정을 디스커션에 정리해두었습니다 H2와 MySQL의 TINYINT 타입 불일치 #117
CommentRepository.findCommentTreeByPostId()의 단위 테스트 코드가 profile 변경에 의해 깨졌습니다.H2은 MySQL과 달리 RECURSIVE 문이 동작하지 않으므로 MySQL을 사용하기 위해서 local 로 profile을 지정해놨는데,
이 profile 이름을 dev 로 바꿈에 따라서 깨졌던 것입니다.
ActiveProfile을 dev 로 바꿔 테스트 통과시켰습니다.
(하지만 이렇게 profile이나 db의 종류에 의존하는 테스트코드가 베스트라고 생각하진 않습니다..😔)
특이 사항
위 두가지 문제 모두, test 환경에서는 H2을, 개발 환경에서는 MySQL을 사용하기에 생기는 문제입니다.
이를 해결하기 위해서 따로 이슈를 팠으며, #119
이 PR에서는 우선 테스트 코드가 다 통과하게 하는 것이 목적이었기에 여기까지 하고 PR 올립니다!
리뷰 요구사항 (선택)